<?php include("../../includes/includes.php"); ?>
<?php
connect($config);
$loggedInTeam = getLoggedInTeam();

clearPositions($loggedInTeam->id);

$positions = Position::getAll();
$count = count($positions);
for ($i = 0; $i < $count; $i++) {
	if (substr($positions[$i], 0, 1) != "E") {
		$playerId = $_GET[$positions[$i]];
		if ($playerId != -1) {
			setPosition($loggedInTeam->id, $playerId, $positions[$i]);
		}
	}
}

updateReserves($loggedInTeam->id);
mysql_close();

header( 'Location: homePage.php' );
?>
